<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:th="http://www.thymeleaf.org">

<head>

<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<title>消息代理平台Message Agent</title>

<link href="css/bootstrap.min.css" rel="stylesheet" />

<link href="css/plugins/dataTables/datatables.min.css" rel="stylesheet" />

<link href="css/animate.css" rel="stylesheet" />
<link href="css/style.css" rel="stylesheet" />

<!-- Mainly scripts -->
<script src="js/jquery-2.1.1.js"></script>
<script src="js/bootstrap.min.js"></script>


<script src="js/plugins/dataTables/datatables.min.js"></script>



<!-- Page-Level Scripts 	dom : '<"html5buttons"B>lTfgitp',-->
<script>
	$(document).ready(function() {
		var oTable = $('#editable').DataTable({
		});
		
	});
	
	function addConfigInfo(){
		$.ajax({
			type : 'POST',
			dataType : "json",
			url : "http://localhost:8080/mqrest/addConfigInfo",
			data : $('#configinfo').serialize(),
			success : function(data) {
				if (data.result == "success") {
					window.location.href = "/mqrest/getConfigInformation";
				} else {
					alert(data.message);
				}
			}
		});
	}
	
	
	
</script>

</head>
<body>
	<div id="wrapper">
		<!--head starter -->
		<nav class="navbar-default navbar-static-side" role="navigation">
			<div class="sidebar-collapse">
				<ul class="nav metismenu" id="side-menu">
					<li class="active"><a href="#"><i class="fa fa-table"></i>
							<span class="nav-label">消息平台代理</span><span class="fa arrow"></span></a>
						<ul class="nav nav-second-level">
							<li class="active"><a href="/mqrest/connectInfo">申请信息</a></li>
							<li class="active"><a href="/mqrest/getTopicInformation">主题信息</a></li>
							<li class="active"><a href="/mqrest/getQueueInformation">队列信息</a></li>
							<li class="active"><a href="/mqrest/getSysInformation">系统信息</a></li>
							<li class="active"><a href="/mqrest/getConfigInformation">回调配置</a></li>
						</ul></li>

				</ul>

			</div>
		</nav>
		<!--head end -->
		<!-- modal start -->
		<div id="modal-form" class="modal fade" aria-labelledby="connectInfo"
			aria-hidden="true">
			<div class="modal-dialog">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal"
							aria-hidden="true">&times;</button>
						<h4 class="modal-title" id="connectInfo">添加用户申请</h4>
					</div>
					<div class="modal-body">
						<!-- 添加信息start -->
						<form id="configinfo" name="configinfo" method="post">
							 <label class="control-label">系统编码</label> 
								<select class="form-control" name="sysid" >
									<option value="">--请选择--</option>
									<option th:each="system : ${systems}" th:value="${system.id}"  th:text="${system.sysname}"></option>
								</select>
								<label class="control-label">回调名称</label> <input type="text"
								name="configname"  class="form-control" />
								<label class="control-label">回调地址</label> <input type="text"
								name="callbackurl" class="form-control" /> 
								<label class="control-label">回调参数</label>
							<input type="text" name="callbackparam" class="form-control" />
						</form>
						<!-- 添加信息stop -->
					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
						<button type="button" class="btn btn-primary"
							onclick="addConfigInfo()">提交更改</button>
					</div>
				</div>
			</div>
		</div>
		<!-- modal end -->

		<div id="page-wrapper" class="gray-bg">
			<div class="row border-bottom"></div>
			<div class="row wrapper border-bottom white-bg page-heading">
				<div class="col-lg-10">
					<h2>消息代理平台---主题信息</h2>
					<ol class="breadcrumb">
						<li><a href="index.html">主页</a></li>
						<li><a>消息平台代理</a></li>
						<li class="active"><strong>申请信息</strong></li>
					</ol>
				</div>
				<div class="col-lg-2"></div>
			</div>
			<div class="wrapper wrapper-content animated fadeInRight">
				<div class="row">
					<div class="col-lg-12">
						<div class="ibox float-e-margins">
							<div class="ibox-title">
								<!-- <h5>
									 Editable Table in- combination with jEditable 
								</h5> -->
								<div class="ibox-tools">
									<a class="collapse-link"> <i class="fa fa-chevron-up"></i>
									</a> <a class="dropdown-toggle" data-toggle="dropdown" href="#">
										<i class="fa fa-wrench"></i>
									</a>
									<ul class="dropdown-menu dropdown-user">
										<li><a href="#">Config option 1</a></li>
										<li><a href="#">Config option 2</a></li>
									</ul>
									<a class="close-link"> <i class="fa fa-times"></i>
									</a>
								</div>
							</div>
							<div class="ibox-content">
								<div>
									<a data-toggle="modal" class="btn btn-primary"
										href="#modal-form" >添加配置信息</a>
								</div>
								<table class="table table-striped table-bordered table-hover "
									id="editable">
									<thead>
										<tr>
											<th>配置名称</th>
											<th>系统名称</th>
											<th>回调地址</th>
											<th>回调函数</th>
											<th>创建时间</th>
											<!--<th>操作</th> -->
										</tr>
									</thead>
									<tbody>
										<tr class="gradeA" th:each="config : ${configs}">
											<td th:text="${config.configname}"></td>
											<td th:text="${config.sysname}"></td>
											<td th:text="${config.callbackurl}"></td>
											<td th:text="${config.callbackparam}"></td>
											<td th:text="${config.createtime}"></td>
											<!-- <td width="16%"><a role="button" href="#myModal" data-toggle="modal"
												data-target="#myModal" th:name="${queue.id}" th:onclick="'queueBind(this)'" class="btn btn-primary btn-sm">关联队列</a>
											</td> -->
										</tr>
									</tbody>
								</table>
								<!-- 模态框（Modal）start -->
								<div class="modal fade" id="myModal" tabindex="-1" role="dialog"
									aria-labelledby="myModalLabel" aria-hidden="true">
									<div class="modal-dialog">
										<div class="modal-content">
											<div class="modal-header">
												<button type="button" class="close" data-dismiss="modal"
													aria-hidden="true">&times;</button>
												<h4 class="modal-title" id="myModalLabel">关联队列
												</h4>
											</div>
											<div class="modal-body">
												<iframe src="" id="QueueBind" width="400px" height="200px" frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling="no" allowtransparency="yes" ></iframe>
											</div>
											<div class="modal-footer">
												<button type="button" class="btn btn-default"
													data-dismiss="modal">关闭</button>
												<button type="button" onclick="editconfirm()" class="btn btn-primary">提交更改
												</button>
											</div>
										</div>
										<!-- /.modal-content -->
									</div>
									<!-- /.modal -->
								</div>
								<!-- 模态框（Modal）stop -->
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</body>

</html>
